package com.lungle.warmdiary.app.content.db.helper;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;


public class CacheSQLiteOpenHelper extends SQLiteOpenHelper {

    public CacheSQLiteOpenHelper(Context context, String name) {
        super(context, name, null, 4);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("create table T_my_media_accounts (id integer primary key autoincrement,mid varchar(20) unique,name varchar(15), platform integer, username varchar(15),logo varchar(200), status integer);");
        db.execSQL("create table T_image_upload (id integer primary key autoincrement,aid varchar(20) ,mid varchar(20) ,file_path varchar(100));");
        db.execSQL("create table if not exists T_campaign_comment (id integer primary key autoincrement,pid text , rate integer ,content text, images text)");
        db.execSQL("create table if not exists T_industry (id integer primary key autoincrement, industryid integer , url text, name text)");
        db.execSQL("create table if not exists T_industry_apply (id integer primary key autoincrement,industryid text , content text)");

//		db.execSQL("create table T_my_gantime (id integer primary key autoincrement,tagName varchar(25) ,startTime integer,endTime integer,intervalTime integer,cDate text)");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        if (newVersion == 4) {
            db.execSQL("create table if not exists T_campaign_comment (id integer primary key autoincrement,pid text , rate integer ,content text, images text)");
            db.execSQL("create table if not exists T_industry (id integer primary key autoincrement, industryid integer , url text, name text)");
            db.execSQL("create table if not exists T_industry_apply (id integer primary key autoincrement, industryid text , content text)");
        }
//		db.execSQL("create table if not exists T_my_gantime (id integer primary key autoincrement,tagName varchar(25) ,startTime integer,endTime integer,intervalTime integer,cDate text)");
    }

}
